/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.matrimonysite.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author khanhnguyen
 */
@Entity
@Table(name = "userRequestResponse", catalog = "MatrimonySite", schema = "dbo")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "UserRequestResponse.findAll", query = "SELECT u FROM UserRequestResponse u"),
    @NamedQuery(name = "UserRequestResponse.findByRequestID", query = "SELECT u FROM UserRequestResponse u WHERE u.requestID = :requestID"),
    @NamedQuery(name = "UserRequestResponse.findByRelationship", query = "SELECT u FROM UserRequestResponse u WHERE u.relationship = :relationship"),
    @NamedQuery(name = "UserRequestResponse.findByTitle", query = "SELECT u FROM UserRequestResponse u WHERE u.title = :title"),
    @NamedQuery(name = "UserRequestResponse.findByComment", query = "SELECT u FROM UserRequestResponse u WHERE u.comment = :comment"),
    @NamedQuery(name = "UserRequestResponse.findByRequestStatus", query = "SELECT u FROM UserRequestResponse u WHERE u.requestStatus = :requestStatus"),
    @NamedQuery(name = "UserRequestResponse.findByResponseStatus", query = "SELECT u FROM UserRequestResponse u WHERE u.responseStatus = :responseStatus"),
    @NamedQuery(name = "UserRequestResponse.findByCreatedDate", query = "SELECT u FROM UserRequestResponse u WHERE u.createdDate = :createdDate")})
public class UserRequestResponse implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "requestID", nullable = false)
    private Integer requestID;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 255)
    @Column(name = "relationship", nullable = false, length = 255)
    private String relationship;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "title", nullable = false, length = 50)
    private String title;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 255)
    @Column(name = "comment", nullable = false, length = 255)
    private String comment;
    @Column(name = "requestStatus")
    private Integer requestStatus;
    @Basic(optional = false)
    @NotNull
    @Column(name = "responseStatus", nullable = false)
    private int responseStatus;
    @Column(name = "createdDate")
    @Temporal(TemporalType.TIMESTAMP)
    private Date createdDate;
    @JoinColumn(name = "resUserID", referencedColumnName = "userID")
    @ManyToOne
    private Users resUserID;
    @JoinColumn(name = "reqUserID", referencedColumnName = "userID")
    @ManyToOne
    private Users reqUserID;

    public UserRequestResponse() {
    }

    public UserRequestResponse(Integer requestID) {
        this.requestID = requestID;
    }

    public UserRequestResponse(Integer requestID, String relationship, String title, String comment, int responseStatus) {
        this.requestID = requestID;
        this.relationship = relationship;
        this.title = title;
        this.comment = comment;
        this.responseStatus = responseStatus;
    }

    public Integer getRequestID() {
        return requestID;
    }

    public void setRequestID(Integer requestID) {
        this.requestID = requestID;
    }

    public String getRelationship() {
        return relationship;
    }

    public void setRelationship(String relationship) {
        this.relationship = relationship;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public Integer getRequestStatus() {
        return requestStatus;
    }

    public void setRequestStatus(Integer requestStatus) {
        this.requestStatus = requestStatus;
    }

    public int getResponseStatus() {
        return responseStatus;
    }

    public void setResponseStatus(int responseStatus) {
        this.responseStatus = responseStatus;
    }

    public Date getCreatedDate() {
        return createdDate;
    }

    public void setCreatedDate(Date createdDate) {
        this.createdDate = createdDate;
    }

    public Users getResUserID() {
        return resUserID;
    }

    public void setResUserID(Users resUserID) {
        this.resUserID = resUserID;
    }

    public Users getReqUserID() {
        return reqUserID;
    }

    public void setReqUserID(Users reqUserID) {
        this.reqUserID = reqUserID;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (requestID != null ? requestID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof UserRequestResponse)) {
            return false;
        }
        UserRequestResponse other = (UserRequestResponse) object;
        if ((this.requestID == null && other.requestID != null) || (this.requestID != null && !this.requestID.equals(other.requestID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.matrimonysite.entity.UserRequestResponse[ requestID=" + requestID + " ]";
    }
    
}
